﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/Admin.Master" AutoEventWireup="true"
    CodeBehind="AdminHome.aspx.cs" Inherits="EngineeringMaster.Administrator.AdminHome" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    工程硕士管理系统
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../Admin.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .repeater_head
        {
            font-family: 宋体, Arial, Helvetica, sans-serif;
            font-size: large;
            font-weight: normal;
            color: #FFFFFF;
            width: 100%;
            position: relative;
            margin-bottom: 50px;
        }
        .tb_head
        {
            background-color: #037;
            border-bottom: solid 1px #ff0;
            border-top: solid 1px #ff0;
        }
        .tb_body
        {
            background: #0a9;
            margin-bottom: 20px;
        }
    </style>
    <div style="position: absolute; right: 10px; background-color: #aa3; top: 10px;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
                    <HeaderTemplate>
                        <div class="repeater_head">
                            本学期已经存在的课程:
                        </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div class="tb_head">
                            <table>
                                <tr>
                                    <td>
                                        <span>
                                            <h3 style="position: relative; float: left">
                                                课程名：</h3>
                                            <%# DataBinder.Eval(Container.DataItem, "CourseName") %>
                                        </span>
                                    </td>
                                    <td>
                                        <span>
                                            <h3 style="margin-left: 50px; float: left">
                                                教师：</h3>
                                            <%# Eval("TeacherName") %>
                                        </span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="tb_body">
                            <table>
                                <tr>
                                    <span>
                                        <td>
                                            上课年月:<%# DataBinder.Eval(Container.DataItem, "CourseYear") %>
                                        </td>
                                    </span><span>
                                        <td>
                                            课程学期:<%# DataBinder.Eval(Container.DataItem, "CourseSemester")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            是否双语教学:<%# ((DataBinder.Eval(Container.DataItem, "Bilingual")) != null && DataBinder.Eval(Container.DataItem, "Bilingual")  == "1") ? "是" : "否"%>
                                        </td>
                                    </span><span>
                                        <td>
                                            拟招学生人数:
                                            <%#DataBinder.Eval(Container.DataItem, "StudentNumber") %>
                                        </td>
                                    </span>
                                </tr>
                                <tr>
                                    <td>
                                        <span>是否向外:
                                            <%# (DataBinder.Eval(Container.DataItem, "ExternalOrNot") != null && DataBinder.Eval(Container.DataItem, "ExternalOrNot") == "1") ? "是" : "否"%>
                                        </span>
                                    </td>
                                    <span>
                                        <td>
                                            教科书:
                                            <%# DataBinder.Eval(Container.DataItem, "Textbook")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            考试形式:<%#DataBinder.Eval(Container.DataItem, "ExamMode")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            信用:<%#DataBinder.Eval(Container.DataItem, "Credit")%>
                                        </td>
                                    </span>
                                </tr>
                                <tr>
                                    <span>
                                        <td>
                                            上课时间 ：<%#DataBinder.Eval(Container.DataItem, "ClassTime")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            上课地点:
                                            <%#DataBinder.Eval(Container.DataItem, "Place")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            授课方式:<%#DataBinder.Eval(Container.DataItem, "InstruMode")%>
                                        </td>
                                    </span><span>
                                        <td>
                                            所属类别:<%#DataBinder.Eval(Container.DataItem, "Category")%>
                                        </td>
                                    </span>
                                </tr>
                                <tr>
                                    <td>
                                        属性：
                                    </td>
                                    <td colspan="3">
                                        <%#DataBinder.Eval(Container.DataItem, "Property")%>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="4">
                                        <asp:Button ID="btnDel" runat="server" Text="删除该课程" Width="130px" Height="40px" CommandArgument='<%# Eval("CourseID") %>'
                                            OnClick="DeleteCourseByID" />
                                        <asp:Button ID="btnEdit" runat="server" Text="编辑该课程" Width="130px" Height="40px"
                                            CommandArgument='<%# Eval("CourseID") %>' />
                                    </td>
                                </tr>
                                <tr>
                                    <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"  Collapsed="True" AutoCollapse="true" AutoExpand="true" CollapsedSize="0" ExpandedSize="400" TargetControlID="Panel1" ExpandControlID="btnEdit" CollapseControlID="btnEdit">
                                    </asp:CollapsiblePanelExtender>
                                    <td colspan="4">
                                        <asp:Panel ID="Panel1" runat="server">
                                            <table style="width: 100%; border-collapse: collapse; background-color: #FFFFFF;
                                                color: Black">
                                                <tr>
                                                    <td style="height: 16px">
                                                        课程名
                                                    </td>
                                                    <td style="height: 16px">
                                                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td style="height: 16px">
                                                        学年
                                                    </td>
                                                    <td style="height: 16px">
                                                        <asp:DropDownList ID="ddCourseYear" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        学期
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        是否双语
                                                    </td>
                                                    <td>
                                                        <asp:RadioButton ID="RadioButton1" runat="server" GroupName="bilingual" Text="是" />
                                                        <asp:RadioButton ID="RadioButton2" runat="server" GroupName="bilingual" Text="否" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        教材
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        是否面向外
                                                    </td>
                                                    <td>
                                                        <asp:RadioButton ID="RadioButton3" runat="server" GroupName="external" Text="是" />
                                                        <asp:RadioButton ID="RadioButton4" runat="server" GroupName="external" Text="否" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        考核形式
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddExamMode" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td>
                                                        拟招人数
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="height: 16px">
                                                        信用
                                                    </td>
                                                    <td style="height: 16px">
                                                        <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td style="height: 16px">
                                                        教师
                                                    </td>
                                                    <td style="height: 16px">
                                                        <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDataSource1"
                                                            DataTextField="TeacherName" DataValueField="TeacherName">
                                                            <asp:ListItem></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MSEDataBaseConnectionString %>"
                                                            SelectCommand="SELECT [TeacherName], [TeaSchoolID], [TeacherID] FROM [Teacher]">
                                                        </asp:SqlDataSource>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        信用时间
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="tbCredit" runat="server"></asp:TextBox>
                                                        <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="tbCredit"
                                                            Format="yyyy-MM-dd" CssClass="MyCalendar" TodaysDateFormat="yyyy-MMMM-dd">
                                                        </asp:CalendarExtender>
                                                    </td>
                                                    <td>
                                                        上课地点
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        上课时间
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="tbDate" runat="server" Height="20px" Width="219px"></asp:TextBox>
                                                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="tbDate"
                                                            Format="yyyy-MM-dd" CssClass="MyCalendar" TodaysDateFormat="yyyy-MMMM-dd">
                                                        </asp:CalendarExtender>
                                                    </td>
                                                    <td>
                                                        授课模式
                                                    </td>
                                                    <td>
                                                        <asp:RadioButton ID="RadioButton5" runat="server" Text="实践" GroupName="instruMode" />
                                                        <asp:RadioButton ID="RadioButton6" runat="server" Text="理论" GroupName="instruMode" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        属性
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox7" runat="server" Height="127px" Width="381px"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        所属类别
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="SqlDataSource2"
                                                            DataTextField="CategoryType" DataValueField="CategoryType">
                                                        </asp:DropDownList>
                                                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MSEDataBaseConnectionString %>"
                                                            SelectCommand="SELECT [CategoryType], [CategoryName] FROM [CourseType]"></asp:SqlDataSource>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="4" align="right" style="position: relative; margin-right: 200px">
                                                        <asp:Button ID="Button1" runat="server" Text="添加" Width="100px" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </ItemTemplate>
                    <FooterTemplate>
                        <div class="repeater_head">
                            本学期已经存在的课程
                        </div>
                    </FooterTemplate>
                </asp:Repeater>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MSEDataBaseConnectionString %>"
            SelectCommand="SELECT [CourseID], [TeacherName],[CourseName], [Bilingual], [CourseYear], [CourseSemester], [ExternalOrNot], [Textbook], [ExamMode], [Credit],  [StudentNumber], [CreditHour], [Place], [ClassTime], [Property], [InstruMode], [Category] FROM [Course] INNER JOIN [Teacher] ON Course.TeaSchoolID = Teacher.TeaSchoolID">
        </asp:SqlDataSource>
    </div>
    <br />
    <b>Repeater2:</b>
    <br />
    <asp:Repeater ID="Repeater2" runat="server">
        <HeaderTemplate>
            Company data:
        </HeaderTemplate>
        <ItemTemplate>
            <%# DataBinder.Eval(Container.DataItem, "Name") %>
            (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
        </ItemTemplate>
        <SeparatorTemplate>
            ,
        </SeparatorTemplate>
    </asp:Repeater>
</asp:Content>
